﻿using System;

namespace TLang
{
    using Ast;


    public class GeneralError : Exception
    {
        public String msg;
        public Node location;


        public GeneralError(Node location, String msg)
        {
            this.msg = msg;
            this.location = location;
        }


        public GeneralError(String msg)
        {
            this.msg = msg;
        }


        public override String ToString()
        {
            if (location != null)
            {
                return location.GetFileLineCol() + ": " + msg;
            }
            else
            {
                return msg;
            }
        }
    }
}
